package com.tangcco.biz.impl;

import com.tangcco.biz.CommentBiz;
import com.tangcco.dao.CommentMapper;
import com.tangcco.pojo.Comment;
import com.tangcco.pojo.Page;
import com.tangcco.pojo.Reply;
import com.tangcco.pojo.VoteLog;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("commentBiz")
public class CommentBizImpl implements CommentBiz{
	@Resource
	private CommentMapper commentMapper;

	@Override
	public int selectCommentCount(String musicRid) {
		return commentMapper.selectCommentCount(musicRid);
	}

	@Override
	public List<Comment> selectHotComment(String musicRid) {
		return commentMapper.selectHotComment(musicRid);
	}

	@Override
	public List<Comment> selectByMusicRid(String musicRid,Page page) {
		return commentMapper.selectByMusicRid(musicRid,page);
	}

	@Override
	public Reply selectOldComment(Integer cId) {
		return commentMapper.selectOldComment(cId);
	}

	@Override
	public int insertComment(Comment comment) {
		return commentMapper.insertComment(comment);
	}

	@Override
	public int insertRelation(Integer parentId, Integer childId,String musicRid) {
		return commentMapper.insertRelation(parentId,childId,musicRid);
	}

	@Override
	public int deleteComment(Integer id) {
		return commentMapper.deleteComment(id);
	}

	@Override
	public int updateLikeNum(Integer id, Integer uId, Integer isZan) {
		return commentMapper.updateLikeNum(id,uId,isZan);
	}

	@Override
	public int updateVotelog(Integer cId, Integer uId,Integer isZan) {
		return commentMapper.updateVotelog(cId,uId,isZan);
	}

	@Override
	public int insertVotelog(VoteLog voteLog) {
		return commentMapper.insertVotelog(voteLog);
	}

	@Override
	public VoteLog selectVoteLogById(Integer cId, Integer uId) {
		return commentMapper.selectVoteLogById(cId,uId);
	}

	@Override
	public List<VoteLog> selectVoteLog() {
		return commentMapper.selectVoteLog();
	}
}
